package com.tsmti.basicdata.entity;

import com.tsmti.core.common.entity.BaseDataEntity;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Where;

import javax.persistence.*;

/**
 * path：com.tsmti.lab.entity
 *
 * @author: ft
 * time: 2018/7/2 11:41
 * Description:
 * 医院科室表
 */
@Entity
@Table(name = "PIMS_DEPTINFOMATION", catalog = "")
@DynamicInsert
@DynamicUpdate
@Where(clause = "delFlag = 0")
public class DeptInfomation extends BaseDataEntity<Long> {
    /**
     * ID
     */
    private Long id;
    /**
     * 编号
     */
    private String code;
    /**
     * 名称
     */
    private String name;
    /**
     * 上级ID
     */
    private Long parentId;
    /**
     * 级次
     */
    private Integer deptLevel;
    /**
     * 排序号
     */
    private Integer sort;
    /**
     * 是否启用
     */
    private Integer enable;

    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PIMS_DEPTINFOMATION")
    @SequenceGenerator(name = "SEQ_PIMS_DEPTINFOMATION", sequenceName = "DEPTINFOMATION_SEQUENCE", allocationSize = 1)
    @Override
    public Long getId() {
        return id;
    }

    @Override
    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "CODE")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "NAME")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "PARENTID")
    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    @Basic
    @Column(name = "DEPTLEVEL")
    public Integer getDeptLevel() {
        return deptLevel;
    }

    public void setDeptLevel(Integer deptLevel) {
        this.deptLevel = deptLevel;
    }


    @Basic
    @Column(name = "SORT")
    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    @Basic
    @Column(name = "ENABLE")
    public Integer getEnable() {
        return enable;
    }

    public void setEnable(Integer enable) {
        this.enable = enable;
    }
}
